<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui">
	
<div id="advertisements">
<h:form id="f1">
	
	<table class="adv-tabs" style="border-left: 1px solid; border-bottom: 1px solid; border-top: 1px solid; border-right: 0px; border-collapse: collapse;border-spacing: 0; width: 100%;">
		<tr>
			<td style="width: 20%;"><c:forEach items="#{appBean.advers}"
					var="adv">
					<div>
					
						<p:commandButton id="cmd_${adv.id}" ajax="true" update="adverto" 
							action="#{advsBean.openAdvertisement}" onclick="activateTab('cmd_${adv.id}');"
							styleClass="tab tab-selector"
							
							style="width:150px;border-radius: 0px 7px 7px 0px; margin-top:0px;margin-bottom:0px; font-size: 16px; font-family:Arial,sans-serif;" value="${adv.title}"
							oncomplete="initSlider()">
							<f:param name="ADV_ID" value="${adv.id}" />
						</p:commandButton>
					</div>
					
				</c:forEach></td>
			<td>
				<p:outputPanel id="adverto" styleClass="slides" layout="block" style="height:230px;margin:0px auto;text-align:center;">
					<c:forEach items="#{advsBean.advertisement.adverAttchments}"
						var="advAttach">
						<h:commandLink action="#{advsBean.downloadMAdvPDFFile}" immediate="true" >
							<p:graphicImage style="margin:0px auto;"
								value="/resources/images/m_advs/${advAttach.icon}" height="230px" width="700px">
							</p:graphicImage>
							<f:param name="FILE_NAME" value="${advAttach.pdf}"/>
						</h:commandLink>
					</c:forEach>
				</p:outputPanel>
					
			</td>
		</tr>
	</table>
</h:form>
</div>
</html>
